import java.util.ArrayList;
import java.util.List;

/**
 * This class represent the parsed page content.
 * Page Parser will create and populate this object and put it to the analyzer Queue.
 *
 * @author mayuri
 * @version Winter 2014
 * 
 */
 
public class ParsedPageContent {

    /**
     * Main page url of the page
     */
    private String myPageUrl;

    /**
     * stores the list of url present in the Page
     */
    private List<String> subUrls = new ArrayList<String>();

    /**
     * Page text content
     */
     private String textContent;

    /**
     * WE have to Keep more state here....
     */

     public ParsedPageContent(String thePageUrl) {
           this.myPageUrl =   thePageUrl;
     }

    public String getTextContent() {
        return textContent;
    }

    public void setTextContent(String textContent) {
        this.textContent = textContent;
    }

    /**
     *
     * @param the_url
     */
    public void addSubURL(String the_url)
    {
        subUrls.add(the_url);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(" [\nPARSED PAGE CONTENT--\n") ;
        sb.append(" URL: " + myPageUrl +"\n");
        sb.append(" SUBURLs: " + subUrls +"\n");
        sb.append(" textContent: "+ textContent +"\n");
        sb.append("]");
        return sb.toString();
    }
}
